//package com.ruoyi.seckill;
//
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
//import com.ruoyi.system.domain.SeckillGoods;
//import org.apache.ibatis.annotations.Param;
//import org.apache.ibatis.annotations.Update;
//
//// SeckillGoodsMapper.java
//public interface SeckillGoodsMapper extends BaseMapper<SeckillGoods> {
//
//    /**
//     * 扣减库存（带乐观锁）
//     * @param goodsId 商品ID
//     * @param version 版本号
//     * @return 更新影响的行数
//     */
//    @Update("UPDATE seckill_goods SET stock_count = stock_count - 1, version = version + 1 " +
//            "WHERE id = #{goodsId} AND stock_count > 0 AND version = #{version}")
//    int decreaseStockWithVersion(@Param("goodsId") Long goodsId, @Param("version") Long version);
//}
